package top.sjydzq.one.Controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import top.sjydzq.one.Mapper.ArticleMapper;

@Controller
public class HomeController {
    @Autowired
    private ArticleMapper articleMapper;

    @RequestMapping("/")
    public String home(Model model) {
        model.addAttribute("articles", articleMapper.selectAll());

        return "home";
    }
}
